package cash.cmp.personal_financial_system.mapper;

import cash.cmp.personal_financial_system.model.Role;
import cash.cmp.personal_financial_system.model.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserMapper {

    List<User> findAllUser();
    List<User> findAllByPage(int page, int pageSize);

    List<User> findByAll(Integer id, String tel, Integer sex,String city ,int page, int pageSize);

    List<User> findByLike(String like);
    int countByAll(Integer id, String tel, Integer sex,String city);
    int countUser();
    User findUserById(Integer id);
    User findUserByTel(String tel);
    User findUserByWechat(String wechatId);
    User findUserByAlipay(String alipayId);
    Boolean insertUser(User user);
    List<Role> getUserRolesById(Integer id);
    Boolean updateUser(User user);
    Boolean updateImage(String headImage , int id);
    Boolean updateWx(String WeChatId, int id);
    Boolean updateApiPay(String ApiPayId, int id);
    Boolean updateTel(String tel, int id);
    Boolean deleteUser(Integer id);
    Boolean saveList(List<User> list);

}
